<?php 
	session_start();
    require_once('../cfg/config.php');
	if(!isset($_GET['id'])) { exit; }
	try {
		$cnx = new PDO('mysql:host='.$PARAM_hote.';port='.$PARAM_port.';dbname='.$PARAM_nom_db, $PARAM_utilisateur, $PARAM_mdp);
	} catch(Exception $e) {
		echo 'Erreur : '.$e->getMessage().'<br />';
		echo 'N° : '.$e->getCode();
	}
	// ON RECUPERE LA LISTE DES UTILISATEURS ASSOCIES AU SERVEUR
	$users = $cnx->query('SELECT * FROM server_user WHERE server_id = '.(int)$_GET['id']);
	$users->setFetchMode(PDO::FETCH_OBJ);
?>
<table cellpadding="0" cellspacing="0" border="0" style="font-size:12px;" id="table_srv">
<?php 
	while($u = $users->fetch()) {
		$user = $cnx->query('SELECT * FROM user WHERE id='.$u->user_id);
		$user->setFetchMode(PDO::FETCH_OBJ);
		$usr = $user->fetch();
?> 
 <tr>
  <td width="25"><img src="img/serv_del.png" width="16" height="16" border="0" style="cursor:pointer;" onclick="javascript:deleteUser(<?php echo $u->id; ?>)" /></td>
  <td><?php echo htmlentities($usr->usrnom).' '.htmlentities($usr->usrpre).' ('.htmlentities($usr->usrlog).')'; ?></td>
 <td></td>
</tr>
<?php 
 	}
?>
</table>